package com.maimao.model.goods;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author MaoLin Wang
 * @date 2020/11/28 12:00 上午
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("mm_spec_group")
@JsonInclude(JsonInclude.Include.NON_NULL)

public class SpecGroup implements Serializable {
    private static final long serialVersionUID = 1682489836064233080L;

    @TableId(type = IdType.AUTO,value = "id")
    private Integer id;

    @NotBlank(message = "请填写规格组名")
    @TableField("name")
    private String name;

    /**
     * 所属三级分类id
     */
    @TableField("category_id")
    @NotNull(message = "请选择所在三级分类")
    private Integer categoryId;

    @NotNull(message = "请填写排序")
    @TableField("`order`")
    private Integer order;

    /**
     * 可搜索参数 是否为可搜索参数组
     */
    @TableField("search")
    @NotNull(message = "请选择是否为可搜索参数组")
    private Integer search;


    @Override
    public String toString() {
        return "SpecGroup{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", categoryId=" + categoryId +
                ", order=" + order +
                ", search=" + search +
                '}';
    }
}
